package cn.anecansaitin.whimsy;

import cn.anecansaitin.whimsy.client.registers.ModSounds;
import cn.anecansaitin.whimsy.common.register.*;
import cn.anecansaitin.whimsy.common.register.ModLootModifiers;
import cn.anecansaitin.whimsy.test.register.TestBlocks;
import cn.anecansaitin.whimsy.test.register.TestEffects;
import cn.anecansaitin.whimsy.test.register.TestEntities;
import cn.anecansaitin.whimsy.test.register.TestItems;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import software.bernie.geckolib.GeckoLib;

@Mod(Whimsy.MODID)
public class Whimsy {
    public static final String MODID = "whimsy";
    public static final String VERSION = "2.0.0";

    public Whimsy(IEventBus bus) {
        GeckoLib.initialize(bus);
        ModEntities.ENTITIES.register(bus);
        ModBlocks.BLOCKS.register(bus);
        ModItems.ITEMS.register(bus);
        ModBlockEntities.BLOCK_ENTITIES.register(bus);
        ModEffects.EFFECTS.register(bus);
        ModParticles.PARTICLES.register(bus);
        ModEnchantments.ENCHANTMENTS.register(bus);
        ModCreativeTabs.TABS.register(bus);
        ModLootModifiers.MODIFIER.register(bus);
        ModLootPredicates.PREDICATE.register(bus);
        ModDataAttachments.ATTACHMENT_TYPES.register(bus);
        ModAttributes.ATTRIBUTES.register(bus);
        ModSounds.SOUNDS.register(bus);
        ModBattleController.register();
        //加载测试内容
        loadTestObject();
//todo 改造受伤的无敌时间系统，让部分伤害又独立的无敌cd
    }

    public static ResourceLocation resource(String path) {
        return new ResourceLocation(MODID, path);
    }

    private static void loadTestObject() {
        TestItems.load();
        TestBlocks.load();
        TestEntities.load();
        TestEffects.load();
    }
}
